<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>
<body onload="manba()">
<form id="form1"  action="##" method="post">
    <p>用户名：<input name="userName" type="text" id="txtUserName" tabindex="1" size="15" value=""/></p>
    <p>密　码：<input name="password" type="password" id="TextBox2" tabindex="2" size="16" value=""/></p>
    <p><input type="button" value="登录" onclick="login()">&nbsp;<input type="reset" value="重置"></p>
</form>
<p id="manbajingshen">
</p>
<script>
    function login() {
        $.ajax({
            //几个参数需要注意一下
            type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            url: "man" ,//url
            data: $('#form1').serialize(),
            success: function (result) {
                console.log(result);
                console.log(3333333);
                //打印服务端返回的数据(调试用)
                if (result.code == 200) {
                    alert("SUCCESS");
                }
                ;
            },
            error : function() {
                alert("异常！");
            }
        });
    }
    function manba() {
        $("#manbajingshen").html('回家干就完了，奥利给');
    }
</script>
</body>
</html>